//
//  LibyuvColorSpaceConvert.h
//  MediaStreamer
//
//  Created by Think on 16/2/14.
//  Copyright © 2016年 Cell. All rights reserved.
//

#ifndef LibyuvColorSpaceConvert_h
#define LibyuvColorSpaceConvert_h

#include <stdio.h>
#include "ColorSpaceConvert.h"

class LibyuvColorSpaceConvert : public ColorSpaceConvert{

public:
    LibyuvColorSpaceConvert();
    ~LibyuvColorSpaceConvert();
    
    bool RGBAtoI420(MediaStreamer::VideoFrame* rgba, MediaStreamer::VideoFrame* i420);
    
    
    bool ARGBtoI420(MediaStreamer::VideoFrame* argb, MediaStreamer::VideoFrame* i420);

    
    bool NV12toI420(MediaStreamer::VideoFrame* nv12, MediaStreamer::VideoFrame* i420);
    bool NV12toI420_Rotation(MediaStreamer::VideoFrame* nv12, MediaStreamer::VideoFrame* i420, int rotation);
    bool NV12toI420_Crop_Rotation(MediaStreamer::VideoFrame* nv12, MediaStreamer::VideoFrame* i420, int rotation);
    bool NV12toI420_Crop_Rotation_Scale(MediaStreamer::VideoFrame* nv12, MediaStreamer::VideoFrame* i420, int rotation);
    
    bool NV21toI420(MediaStreamer::VideoFrame* nv21, MediaStreamer::VideoFrame* i420);
    bool NV21toI420_Rotation(MediaStreamer::VideoFrame* nv21, MediaStreamer::VideoFrame* i420, int rotation);
    bool NV21toI420_Crop_Rotation(MediaStreamer::VideoFrame* nv21, MediaStreamer::VideoFrame* i420, int rotation);
    bool NV21toI420_Crop_Rotation_Scale(MediaStreamer::VideoFrame* nv21, MediaStreamer::VideoFrame* i420, int rotation);
    bool NV21toI420_Crop_Rotation_Scale_Mirror(MediaStreamer::VideoFrame* nv21, MediaStreamer::VideoFrame* i420, int rotation);
private:
    MediaStreamer::VideoFrame *mI420;
    MediaStreamer::VideoFrame *mI420UnMirror;
};

#endif /* LibyuvColorSpaceConvert_h */
